<template>
<!--计划审批-->
  <div class="jhsp">
    <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="60px">
      <el-row style="margin-top: 25px">
        <el-col :span="6">
          <el-form-item label="经办人：" label-width="90px">
            <el-input v-model="ruleForm.shenbaoren" suffix-icon="el-icon-user" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="经办日期：" label-width="90px">
            <el-date-picker
              v-model="ruleForm.riqi"
              type="date"
              placeholder="选择日期"
              style="width: 100%"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="经办部门：" label-width="90px">
            <el-input v-model="ruleForm.bumen" suffix-icon="el-icon-c-scale-to-original" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="N：">
            <el-input v-model="ruleForm.N" placeholder="请输入" ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-form-item label="经办单位：" label-width="90px">
          <el-input v-model="ruleForm.danwei" suffix-icon="el-icon-office-building" placeholder="请输入"></el-input>
        </el-form-item>
      </el-row>
      <div class="form-small-title">
        <el-divider direction="vertical" class="form-divider"></el-divider>
        <span class="form-small-font">基本信息</span>
      </div>
      <el-row style="margin-top: 25px">
        <el-col :span="12">
          <el-form-item label="项目名称：" label-width="90px">
            <el-input v-model="ruleForm.xmmc" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="负责人：" label-width="90px">
            <el-input v-model="ruleForm.fzr" suffix-icon="el-icon-user" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="计划工期：" label-width="90px">
            <el-input v-model="ruleForm.jhgq" placeholder="请输入">
              <template slot="append">天</template>
            </el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row>
        <el-col :span="6">
          <el-form-item label="计划开始：" label-width="90px">
            <el-date-picker
              v-model="ruleForm.jhks"
              type="date"
              placeholder="选择日期"
              style="width: 100%"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="计划完成：" label-width="90px">
            <el-date-picker
              v-model="ruleForm.jhwc"
              type="date"
              placeholder="选择日期"
              style="width: 100%"
            >
            </el-date-picker>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="相关附件：" label-width="90px">
            <el-input v-model="ruleForm.fujian" suffix-icon="el-icon-paperclip" placeholder="请输入"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <div class="form-small-title">
        <el-divider direction="vertical" class="form-divider"></el-divider>
        <span class="form-small-font">任务计划</span>
      </div>
    </el-form>
    <form-table tableState="jhsp" :tableColumns="tableColumns" :tableData="tableData" :defaultData="defaultData"></form-table>
  </div>
</template>

<script>
import FormTable from "@/views/leader/components/formTable";
export default {
  name: "jhsp",
  components: {FormTable},
  data(){
    return{
      ruleForm:{},
      rules:{},
      tableColumns:[
        { prop: 'rwmc', label: '任务名称', align: 'center', type:'input' },
        { prop: 'fzr', label: '负责人', align: 'center', type:'input' },
        { prop: 'ks', label: '开始日期', align: 'center', type:'date' },
        { prop: 'js', label: '结束日期', align: 'center', type:'date' },
        { prop: 'gq', label: '工期', align: 'center', type:'input' },
        { prop: 'lcb', label: '里程碑', align: 'center', type:'checkbox' },
        { prop: 'tjcg', label: '需提交成果', align: 'center', type:'input' },
      ],
      tableData:[
        {rwmc:'',fzr:'',ks:'',js:'',gq:'',lcb:false,tjcg:''}
      ],
      defaultData:['rwmc','fzr','ks','js','gq','lcb','tjcg']
    }
  },
  props:{
    selectRow:{
      type: Object,
      default: ()=>{}
    }
  },
  watch:{
    selectRow:{
      handler(val) {
        if(this.selectRow){
          this.ruleForm = JSON.parse(JSON.stringify(this.selectRow))
          this.ruleForm.xmmc = this.selectRow.projectName
        }
      },
      immediate: true,
    }
  }
}
</script>

<style scoped lang="scss">
.jhsp ::v-deep{
  .el-input__inner {
    border: 0 !important;
    border-bottom: 1px solid #DCDFE6 !important;
    border-radius: 0 !important;
    padding-right: 20px !important;
  }
}
.form-small-title{
  border-bottom: solid 2px #C0C4CC;
  padding-bottom: 10px;
}
.form-divider{
  width: 5px;
  height: 26px;
  background: rgb(66, 185, 131);
}
.form-small-font{
  font-size: 19px;
  font-weight: 600;
  color: #303133;
}
</style>
